# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test06
# Description:  例17.5
# Author:       ASUS
# Date:         2019/5/11
#-------------------------------------------------------------------------------


import threading
from time import sleep,ctime
def fun(index,sec):
    print('开始执行',index,'执行时间:',ctime())
    sleep(sec)
    print('执行结束',index,'执行时间:',ctime())
def main():
    thread1 = threading.Thread(target=fun,args=(10,4))
    #启动线程
    thread1.start()
    thread2 = threading.Thread(target=fun, args=(20, 2))
    thread2.start()
    thread1.join()
    thread2.join()

if __name__=="__main__":
    main()



